Skip to content

Make import keyword change working directory during external compilation#325

Open
WoodchuckXL wants to merge 2 commits into
Morpho-lang:devfrom
WoodchuckXL:iss277
Open

Make import keyword change working directory during external compilation#325
WoodchuckXL wants to merge 2 commits into
Morpho-lang:devfrom
WoodchuckXL:iss277

Conversation

@WoodchuckXL

Copy link
Copy Markdown

Fix for #277.
Changes the global CWD to the current file path during compilation of imported files to allow for them to import files with local paths. The CWD is restored after compilation of the imported file is finished.
Added test for this behavior.

@softmattertheory

softmattertheory commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This is a very useful fix; thanks for the great contribution! There's a macro MORPHO_DIRSEPARATOR that gives the folder separator that might be better to use than hard coded '/'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants